<template>
  <div>这是儿子组件</div>
  <button @click="sendDataHandle">click传递参数</button>
</template>

<script>
import { reactive, defineComponent } from "vue";
export default defineComponent({
  emits: ["sendDataHandle", "sendMsg"],
  setup(props, { emit }) {
    const state = reactive({
      sonData: "son的数据",
    });
    let sendDataHandle = () => {
      emit("sendMsg", state.sonData);
    };

    return {
      state,
      sendDataHandle,
    };
  },
});
</script>

<style></style>
